package com.ruijixiang.leetcode.everyday.leetcode2024.leetcode202408;

public class leetcode20240818 {
    public boolean checkRecord(String s){
        int cntA=0,cntL=0;
        for(char ch : s.toCharArray()){
            if(ch=='A'){
                cntA++;
                cntL=0;
            }else if(ch=='L'){
                cntL++;
            }else{
                cntL=0;
            }
            if(cntA>=2 || cntL>=3){
                return false;
            }
        }
        return true;
    }
}
